package org.JWCB.friend.controller.user;


import jakarta.validation.constraints.NotNull;
import org.JWCB.common.core.controller.BaseController;
import org.JWCB.common.core.domain.dto.QueryDto;
import org.JWCB.common.core.domain.vo.R;
import org.JWCB.common.core.domain.vo.TableDataInfo;
import org.JWCB.friend.service.user.UserMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user/message")
public class UserMessageController extends BaseController {

    @Autowired
    private UserMessageService userMessageService;

    @GetMapping("list")
    public TableDataInfo list(QueryDto queryDto) {
        return userMessageService.list(queryDto);
    }

    @DeleteMapping("del")
    public R<Void> del(@NotNull(message = "id不能为空") Long textId) {
        return toR(userMessageService.del(textId));
    }
}
